<html xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="history">
    <div class="box" id="history_div" style="display: block;">
        <div class="box_1">
            <h3><span>浏览历史</span></h3>

            <div class="boxCenterList clearfix" id="history_list">
                <ul class="clearfix">
                    <li class="goodsimg"><a href="goods.php?id=2" target="_blank"><img src="/static/images/201807/thumb_img/2_thumb_G_1531998478674.jpg" alt="夏装新款纯色短袖T恤洋" class="B_blue"></a></li>
                    <li class="htext"><a href="goods.php?id=2" target="_blank" title="夏装新款纯色短袖T恤洋">夏装新款纯色短...</a><br>本店售价：
                        <font class="f1">￥1元</font><br></li>
                </ul>
                <ul class="clearfix">
                    <li class="goodsimg"><a href="goods.php?id=2" target="_blank"><img src="/static/images/201807/thumb_img/2_thumb_G_1531998478674.jpg" alt="夏装新款纯色短袖T恤洋" class="B_blue"></a></li>
                    <li class="htext"><a href="goods.php?id=2" target="_blank" title="夏装新款纯色短袖T恤洋">夏装新款纯色短...</a><br>本店售价：
                        <font class="f1">￥1元</font><br></li>
                </ul>
                <ul id="clear_history"><a onclick="clear_history()">[清空]</a></ul>
            </div>
        </div>
    </div>
    <div class="blank5"></div>
    <script type="text/javascript">
        if (document.getElementById('history_list').innerHTML.replace(/\s/g, '').length < 1) {
            document.getElementById('history_div').style.display = 'none';
        } else {
            document.getElementById('history_div').style.display = 'block';
        }

        function clear_history() {
            Ajax.call('user.php', 'act=clear_history', clear_history_Response, 'GET', 'TEXT', 1, 1);
        }

        function clear_history_Response(res) {
            document.getElementById('history_list').innerHTML = '';
        }
    </script>
</th:block>

</html>